package com.jxud.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.jxud.Pojo.Order;
import com.jxud.Pojo.PageOrder;
import com.jxud.Pojo.Result;
import com.jxud.Pojo.UpdateOrderStatus;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.Valid;
import org.springframework.stereotype.Service;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

@Service
public interface OrderService {
    /**
     * 根据token 获取到当前客户的订单Service
     * @param request
     * @return
     */
    Map<String,Object> getOrdersByCustomerId(HttpServletRequest request, PageOrder pageOrder);

    /**
     * 根据订单号获取订单的发货信息 Service
     *
     * @param orderId
     */
    void getOrderItemByOrderId(String orderId);


    /**
     * 创建订单 Service
     * @param order
     */
    String createOrder(Order order,HttpServletRequest request);

    /**
     * 关闭订单
     * @param orderId
     * @return
     */
    Integer closeOrder(String  orderId);

    /**
     * 批量获取excel订单
     */
    Result readExcelFile(InputStream inputStream, HttpServletRequest request) throws JsonProcessingException;

    /**
     * 获取不脱敏的单个订单
     * @param orderId 订单编号
     * @return
     */
    List<Order> getOrdersByIdDesens(String orderId);


    /**
     * 更改订单的状态
     * @param updateOrderStatus
     * @param request
     */
    Result UpdateOrderStatus(@Valid UpdateOrderStatus updateOrderStatus, HttpServletRequest request);


    /**
     * 下单前的状态验证
     * @param request
     * @return
     */
    Boolean UserOrderEligibilityService(HttpServletRequest request);
}
